SML=/usr/local/smlnj-110.71
CHAP=chap5
ARCH=x86-darwin

compile :	
		$(SML)/bin/ml-build sources.cm Parse.main

test :		tcheck

tcheck :	
		-$(RM) -rf tc
		/bin/mkdir tc
		-( cd ../testcases ; \
		   for i in *.tig ;  \
		   do           \
			$(SML)/bin/sml @SMLload=../$(CHAP)/sources                \
				       -u                                         \
				       $$i                                        \
				       > ../$(CHAP)/tc/`basename $$i .tig`.ast    \
				       2> ../$(CHAP)/tc/`basename $$i .tig`.err ; \
		   done )

clean :
		-$(RM) -rf sources.$(ARCH) tc *~ tiger.grm.* tiger.lex.*